package com.hqch.mina;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

public class Test {

	public static void main(String[] args) {
		try {
			Socket scSocket = new Socket("127.0.0.1", 8080);
			BufferedReader in = new BufferedReader(new InputStreamReader(scSocket.getInputStream()));
			PrintWriter out = new PrintWriter(scSocket.getOutputStream(),true);
			BufferedReader line = new BufferedReader(new InputStreamReader(System.in));
			out.println(line.readLine());
			line.close();
			out.close();
			in.close();
			scSocket.close();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
